package rpc.utils;

import java.util.concurrent.atomic.AtomicInteger;
import rpc.core.RpcData;

/*********
 *
 *
 *@author 197
 *@date 2020/6/28 20:24
 *
 **/


public class Sequence {

  private static final String ip = Integer.toHexString(IpUtils.localIp().hashCode());
  private static final AtomicInteger indexAtomicInteger = new AtomicInteger();
  private static final String hexString = Long.toHexString(System.nanoTime());

  public static String get() {
    return RpcData.getAppName() + "-" + ip + "-" + hexString + "-"
        + indexAtomicInteger.getAndIncrement();
  }

}
